package dtos;

import java.util.List;


public class TripDTO {
	
	@Override
	public String toString() {
		return  departurePlace+" - "+ arrivalPlace ;
	}

	private int tripID;

	private String arrivalPlace;

	private String departurePlace;

	private List<MeanOfTransportationDTO> meanOfTransportations;

	public TripDTO() {
	}

	public int getTripID() {
		return this.tripID;
	}

	public void setTripID(int tripID) {
		this.tripID = tripID;
	}

	public String getArrivalPlace() {
		return this.arrivalPlace;
	}

	public void setArrivalPlace(String arrivalPlace) {
		this.arrivalPlace = arrivalPlace;
	}

	public String getDeparturePlace() {
		return this.departurePlace;
	}

	public void setDeparturePlace(String departurePlace) {
		this.departurePlace = departurePlace;
	}

	public List<MeanOfTransportationDTO> getMeanOfTransportations() {
		return this.meanOfTransportations;
	}

	public void setMeanOfTransportations(List<MeanOfTransportationDTO> meanOfTransportations) {
		this.meanOfTransportations = meanOfTransportations;
	}

	public MeanOfTransportationDTO addMeanOfTransportation(MeanOfTransportationDTO meanOfTransportation) {
		getMeanOfTransportations().add(meanOfTransportation);
		meanOfTransportation.setTrip(this);

		return meanOfTransportation;
	}

	public MeanOfTransportationDTO removeMeanOfTransportation(MeanOfTransportationDTO meanOfTransportation) {
		getMeanOfTransportations().remove(meanOfTransportation);
		meanOfTransportation.setTrip(null);

		return meanOfTransportation;
	}


}
